<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <script>
        function f(){
            var xmlHttpRequest;

            if(window.XMLHttpRequest){
                //其他浏览器
                xmlHttpRequest=new XMLHttpRequest();
            }else{
                //IE8以前
                xmlHttpRequest=new ActiveXObject("Microsoft.XMLHttp");
            }





            alert(xmlHttpRequest);
        }
    </script>
</head>
<body>
    <a href="JavaScript:;" onclick="f();">点击</a>
</body>
</html>